﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFP;
using SFP.Animation2D;
using SFP.Audio;
using SFP.CollisionDetection;

namespace TestGame
{
    public class Coin : Reaction
    {
        private Player player;
        private LayerManager layerManager;

        public Coin(Player player, LayerManager layerManager)
        {
            this.player = player;
            this.layerManager = layerManager;
        }

        public void pickUpCoin(GameObject gameObj)
        {
            layerManager.getLayer(2).removeLayerObject(gameObj);
            GameObjects.Coins.Remove(gameObj);
            AudioPlayer.play(Ressources.COIN_SOUND, true);
        }

        protected override void fromBeneath(CollisionInfo collisionInfo)
        {
            pickUpCoin(collisionInfo.GameObject);
        }

        protected override void fromAbove(CollisionInfo collisionInfo)
        {
            pickUpCoin(collisionInfo.GameObject);
        }

        protected override void fromLeft(CollisionInfo collisionInfo)
        {
            pickUpCoin(collisionInfo.GameObject);
        }

        protected override void fromRight(CollisionInfo collisionInfo)
        {
            pickUpCoin(collisionInfo.GameObject);
        }

        protected override void touchesTop(CollisionInfo collisionInfo)
        {
        }

        protected override void touchesBottom(CollisionInfo collisionInfo)
        {
        }

        protected override void touchesLeft(CollisionInfo collisionInfo)
        {
        }

        protected override void touchesRight(CollisionInfo collisionInfo)
        {
        }
    }
}
